F1GP/WC Utilities & Add-ons

PatchF1GP 1.8.2

by Grant Reeve, 5 September 1995

Overview

This is a tiny utility that will patch into Formula One Grand Prix (and World Circuit and the A600 version of Formula One Grand Prix) so that it will actually notice ALL button presses, not just the ones it feels like noticing. This makes gear changing a delight, rather than the pain in the arse that it was. No more sticking gears! PatchF1GP will buffer both analog joystick buttons, both digital joystick buttons, and the space bar for keyboard users.

It now also buffers, in a different manner, the direction controls in keyboard and digital keyboard modes. The only time you will notice the difference, is when you try to do some very fine steering, ie: when you are trying to line the car up perfectly for a corner at the end of the straight - now it _will_ notice those tiny taps to the left/right controls that you do the first time you do them. (Well, I do this, so I assume everyone else does too :) )

AND! it can also change the timing interval between frames that F1GP uses, so that if you have GPPatch you can increase the frame rate and play some incredibly smooth F1GP! Normally the game runs at 8 fps, but now you can run it up to 20 fps! Yeah! :)

This program also allows digital joysticks to use both buttons (where available), and keyboard users to use 2 keys to change gears. One for up gear, one for down. Just like a real f1 car. You can define what keys you want to change up or down gears.

And it also allows you to turn traction control on and off (with the "t" key), except for analog joystick mode, where it is fixed at off. If you're good enough, this allows you to go even faster (or so some people claim). If you're not good enough (like me) then you'll fall off every corner due to chronic wheelspin ;-) But practice (LOTS of practice) should fix this. NEW for this version is a correction to the noTC patch that makes the car steer normally with TC off, which is now legal for the Hall of Fame. Previously F1GP decided it wanted to "help" the car steer much more than usual when TC was turned off, allowing you to basically drive around a track with only the accelerator and brake.

F1GP normally randomly degrades the horse power of the players car by anything up to and possibly over 20 horse power. So, you think you have 716 HP, but you might only have 694 or something. This is very stupid, so I remove this degrading routine, so the HP will stay at 716 (or whatever you set it to with F1GP-Ed). (Thanks to Rene Smit for this one. Hi Rene! :) )

PS: for people who want a true sequential gearbox, but don't have a 2 button digital joystick, PatchF1GP will treat 'a' and 'z' as buttons 1 and 2, in addition to reading the normal joystick buttons, so you can have 2 button gear changes even in normal 1 button digital stick mode.

Since F1GP-Ed V2.99, nearly all of these patches that PatchF1GP does are included. But I have updated this program one more time to allow people with 1Mb machines to still get the advantages of this program, since F1GP-Ed uses a lot more RAM than PatchF1GP. If you have F1GP-Ed V2.99 or above, don't bother using this program.

Usage

PatchF1GP [dig2] [key2] [quiet] [nowindow] [tcoff] [notc] [noint]
   [debounce [num]] [swapjbuttons] [kbutton1 <num>]
   [kbutton2 <num>] [nohpfix] [framerate <num>] [ntsc]
   [pitspdlim [km/h]] [nosundry] [noquit]
[dig2]
This option turns on the 2 button digital joystick gear changing

[key2]
This option turns on the 2 key keyboard gear changing (It uses space to go up a gear, and left-amiga to go down a gear)

[quiet]
This tells PatchF1GP to shut up.

[nowindow]
This tells PatchF1GP not to open a window. This could be useful in very low memory situations. (saves about 5K)

[tcoff]
This tells PatchF1GP to start with TC off, for those who prefer driving in this manner.

[notc]
This tells PatchF1GP not to install it's TC patch.

[noint]
This tells PatchF1GP not to install it's interrupt patch. This means that there is no buffering, and no 2 button gear changes, since my interrupt does all the joystick checking for my routines. I leave the 2 button replay routines and the 2 button gear change routine in place, so that you can successfully view replays made with 2 button gear changes.

[debounce [num]]
Some peoples joysticks will have an amount of jitter in the buttons. This means that when the button is pressed, it's state oscillates between on and off momentarily. This gets detected by my patch, and causes some extra unwanted gear changes. If you add the 'debounce' option, PatchF1GP will use a default value for getting rid of this effect (called debouncing). The default value is 3. By adding a number afterwards, you can set the exact debounce factor you want. This value tells PatchF1GP how many calls to its interrupt it should ignore after a button press or release, to allow the button time to settle. Since the interrupt is called 50 or 60 times per second, depending if you are in PAL or NTSC, then this number is how many 50ths or 60ths of a second the button will be ignored for.

[swapjbuttons]
Normally in 2 button joystick mode, button 1 changes up a gear, and button 2 changes down. This option will swap those around.

[kbutton1 <num>] [kbutton2 <num>]
By default, in 2 button keyboard mode, I have set <space> to be button 1, and <left-amiga> to be button 2. But you can tell PatchF1GP exactly what keys you prefer, by specifying their rawkey codes. For example, if you want to swap the current functions, (ie: space= down) then you would type "kbutton1 66 kbutton2 40", since 66 is the rawkey code of left-amiga, and 40 is the rawkey code of space. In 1 button keyboard mode, you can define what that 1 button is with kbutton1. (default is space)

[nohpfix]
This will cause PatchF1GP to leave F1GPs horse power degradation routine intact.

[framerate <num>]
This tells PatchF1GP to install a new timing interval. If it is not on the command line, (or 0) then PatchF1GP will leave the timing as normal. The value of num represents how many vertical blanks should pass between frames, so 3 would be 30 fps in NTSC mode (60/3). (See later section for more info) (See also the ntsc option)

[ntsc]
If this is specified, then PatchF1GP will calculate an appropriate timing value for a 60 Hz NTSC display. Otherwise it will assume that PAL is being used (50 Hz).

[pitspdlim [km/h]]
This is a half complete patch. It will limit your car to whatever speed you specify in the pit lane. Unfortunately the computer cars are not affected. I therefore don't think many people will use it :)

[nosundry]
This tells PatchF1GP not to install some patches that don't fall into any other category.

[noquit]
This tells PatchF1GP not to install it's quit routine, so it won't be able to detect if F1GP quits.

run PatchF1GP after F1GP, and also after F1GP-Ed (v2.42-V2.50 only), since part of F1GP-Ed's analog joystick 2-button routine is THE SAME as PatchF1GP's digital joystick 2-button routine, otherwise PatchF1GP will install this change, then F1GP-Ed may erase it again. Do NOT run PatchF1GP if you are running F1GP-Ed V2.99 or above. You can get PatchF1GP to run without applying any patches at all with: PatchF1GP noquit noint nosundry notc nohpfix

I used to use the following script to execute F1GP:

assign f1gp_disk_#1: ""
assign f1gp_disk_#2: ""
assign f1gp_disk_#3: ""
assign f1gp_disk_#4: ""
run >NIL: f1gp
run >NIL: work:stuff/gppatch/gppatch
wait 5
cd work:stuff/f1gp-ed
f1gp-ed >NIL: SaveToMem championship.data
run >NIL: work:stuff/patchf1gp/patchf1gp debounce framerate 3 ntsc

Quitting

  • If PatchF1GP can't find F1GP, it will quit.
  • If one of PatchF1GP's patches fail, then it will quit, leaving F1GP fully intact.
  • PatchF1GP will automatically quit a second or two after F1GP quits, unless you specify otherwise with "noquit".
  • Clicking on the close window gadget will make it quit after a second or two, as well. Doing this will restore all PatchF1GP's changes to their original condition.

What it does

*) button buffering:

PatchF1GP actually buffers the button presses, so you don't miss gear changes any more. To check that it's working, accelerate up to 6th gear, turn on autofire, and press the button for 1/4 of a second while braking. Enjoy! ;-) If you don't have autofire, just press the button really fast about 8 times. You'll well and truly end up in reverse.

PatchF1GP can buffer up to 12 button presses and releases (24 events) F1GP will read off these events at a rate of 1 per frame. So if you manage to fill up the buffer, (ie: autofire) then it will take about 3-4 seconds to empty the buffer. So expect your gears to go mental until then.

Warning: PatchF1GP will still buffer button events while the game is paused! This can cause havoc when unpaused! It also does not clear the buffer at all, ie: pressing autofire to fill up the buffer, then pressing escape, is not really advised.

*) 2 button gear changing:

This is basically an add on to the buffering routine.

*) traction control:

When you turn traction control off with the "t" key, or with the brand new "traction help" option in the "game option" menu, PatchF1GP basically fools F1GP into thinking that the keyboard and digital joysticks are now analog joysticks. "t" will turn traction control back on when you get sick of sliding off every corner ;-) A side effect of this patch is that it is now possible to change into keyboard mode from analog mode, which was previously impossible. WARNING: at the moment the replay routine doesn't keep track of the state of traction control. So a replay of you alternating between states will cause the car to end up somewhere other than it should be. Steering while TC is off is now corrected, so you can use notTC in the Hall of Fame legally now.

Frame Rate fixing

PatchF1GP can replace the standard timing interval between two frames with a much shorter one, so each frame represents a shorter interval of time to usual. Then it reduces the number of vertical blanks that pass before a screen redraw, so that the game still runs at realtime speed, but a LOT smoother than before. For those of you who have seen GPPatch (Hi Tony!), then you will know that you can change the physical frame rate with the 1 to 6 keys. PatchF1GP will automatically start the game at the correct physical frame rate to get real time simulation. The normal rate of 8 fps is really rather slow and chunky, but 12 fps is a lot smoother, 16 fps is a delight, and 20 fps is just amazing! You get to see the track moving past you, instead of just stepping past, the other cars actually are now seen to MOVE between points, instead of jumping large distances, and the car behaves a lot better, since it is getting more calculations per second.

To put it simply, the game becomes INFINITELY more playable!!!! I now play F1GP at 20 fps and I don't ever want to go back to 8!

At higher frame rates:

  • The car appears to behave more realistically (I think. I've never driven a f1 car before). Slow corners (hairpins) now behave nicely, where before I always got really annoyed at how the car behaved at 8 fps. (I still fall of due to going to fast all the time though :) ) Also, some corners become a lot more difficult, for example, at the last chicane/corner sequence at France, it is very easy to lose all traction with the back of the car, and slide head on into the wall.

  • The computer cars drive slower, depending on how high the frame rate is. If you have F1GP-Ed, you can multiply the Speed Factor (or AI grip) by the following values, and hopefully the cars will drive at about the same times as 8 fps.

    fps  | Speed Factor scale
    -----+---------
    20   | 1.0653
    16.6 | 1.0341
    15   | 1.0227
    12.5 | 1.0114
    12   | 1.0085
    10   | 1.0028

  • my no-TC patch works much more like it does on the PC when you beef up the fps: no more violent losses of control due to high wheel spin at low frame rates. But you can still fall off corners just as easily as before :)

  • qualifying lap times appear to be exactly the same. ie: no weird speed increases, or decreases. Which is good for competing in championships and the Hall Of Fame.
WARNING: Replays made at different frame rates just don't work very well at all. So, if you make a replay, you MUST play it back at that exact same fps, or all the calculations will stuff up, and results in all the cars ending up in strange places. Also, continuing a game which was saved at a different frame rate will result in the air resisitance being incorrect.

WARNING: Do not change the frame rate in the middle of a race/driving session. You must go back out to the main menu before you change it, since the game calculates some values from the time constant when it enters a race/driving session.

How to get the frame rate you want.

Look down the fps list on the right of the table below, and find an fps you want to use. I advise not using 25 fps or above due to some weird bugs. Then get F1GP to use the appropriate screenmode, then run PatchF1GP with the framerate value on the same row (and possibly the ntsc option). Now you drive, and enjoy!!!!

PatchF1GP |    resulting fps
framerate |   PAL        NTSC
  value   | (no ntsc)   (ntsc)
----------+-------------------
    1     |   50          60
    2     |   25          30
    3     |   16.6        20 <- me
    4     |   12.5        15
    5     |   10          12
    6     |   8.3         10
    7     |   -           8.5

I use 20 fps, in NTSC, but I drive with the detail level at minimum on my 4000/040, because in some high detail areas the fps will drop a bit at maximum detail (ie: pit lane, street cricuits, Hockenheim straights)

Here is a small table of around the maximum performance you can expect to get out of various machines while at minimum detail.

Computer   CPU  MHz | fps
--------------------+-----
4000      68040  25 |  20
1200      68030  50 |  16.7/20
1200      68020  14 |  12.5/15
500/600   68000   7 |  8/10

If you have a standard 500 or 600, you can use 10 fps, but the game may slow down a little. It is probably worth the difference in playability though to go to 10 fps. (hairpins are nicer for example)

Bugs

  • If you run the game at 25 fps or above, then in go into race mode, and sometimes in other modes, the car will spin to its left around its axis. I have no idea why it does this at the moment. But, 20 fps works fine.

  • If you are using my interrupt routines, and using autogears, then you will find that when the car is in neutral, and you push forward, the car will gear down into reverse, instead up into 1st. This is very annoying. My suggested solution is to run PatchF1GP with the "noint" option if you use auto-gears. (But you then miss all the buffering features)

Bug reports

If you find a bug, then e-mail me at:

reeve1@lucy.cs.waikato.ac.nz

and tell me all about it. What your system is, what version of F1GP you have, what you've done to it, etc. etc.

Compatability

PatchF1GP has been tested on the following machines:
4000/040 - 10MB ram (my machine)
1200 - standard
1200 - 50 Mhz 68030 with fastram
500+ - 2MB chipram (my old machine that lives in the closet)
2000 - 50MHz 68030 accellerated
500 - standard (1MB ram)

It has been found to be pretty much fully compatible with GPPatch, and F1GP-Ed (up to but not including V2.99) Don't run it if you are using F1GP-Ed V2.99 or above. It should be run after F1GP-Ed V2.42 and upwards if you are not using the latest version though. It will have a minor incompatability with the quitting routines of SplitTime, and GPPerf (also by me but not released at this date), but if you are running these programs too, then you have more than 1Mb ram, and should get F1GP-Ed V3.whatever, which has no problem.

Future

This patch doesn't have much future. It does everything I want it to. Other patches I am writing will either go into F1GP-Ed, or will be seperate programs. I am not going to release any new versions, unless I happen to come accross a fix for either of the bugs listed above.

Thanks

Many thanks go to Oliver Roberts, for lending me the code to find F1GP in memory, + some ideas and beta testing. Also to Edo Nijmeijer for beta testing + ideas. And also to Rene Smit for beta testing + tons of ideas + replays of some bloody fast traction control-less driving for me to drool over.

The Author (me)

I am a 21 year old 3rd year Comp-Math student at Waikato University in New Zealand. I occaisonally do some uni study but mainly muck around with my computer (F1GP, Roketz, programming stuff, or answering e-mail), and read really cool sci-fi/fantasy books with whatever left over time I have. I hope you find this program useful, because I did :)

History

V1.0 6 Feb 1995 (9420 bytes)

  • First real release. Sent to Edo Nijmeijer for beta testing.
  • Fixed problem where the interrupt didn't buffer on anything below a 68040 :)

V1.1 15 Feb 1995 (10084 bytes)

  • Added cute messages to the window
  • Enabled 'unpatching' so if PatchF1GP is quit via the closewindow gadget it will restore any changes it made. (Thanks to Edo Nijmeijer for these suggestions)
  • Gave the source code a slight work-over.

V1.2 2 Mar 1995 (10252 bytes)

  • Added 2 key keyboard gear changing ability.

V1.3 23 Mar 1995 (10496 bytes)

  • Added CPU detection for default interrupt speed selection.
  • Added 'nowindow' keyword.
  • Improved the 1 button digital joystick routines

V1.4 12 Apr 1995 (14692 bytes)

After some prompting from Rene Smit:
  • Added traction control state switching in game with "t" key
  • Added "traction help on/off" to the "game options menu"
  • Enabled keyboard mode switching when in analog joystick mode
  • Fixed CPU detection so that a 68000 gets a "fast" interrupt patch

V1.5 1 May 1995 (15452 bytes)

  • Changed the name from PatchIt to PatchF1GP.
  • Fixed up the replay routines so that they keep track of 2 button gear changes correctly.

V1.6 4 May 1995 (15440 bytes)

  • Removed a very very stupid bug from the replay routine fix I did in V1.5 that caused all replays made before V1.5 to only change up gears. Unfortunately any replays made with V1.5 will probably have gear change problems when playing back (unless you use V1.5 :) )

V1.7 18 May 1995 (15924 bytes)

  • PatchF1GP now patches WC and the A600 version of F1GP. :)
  • At the urging of Oliver Roberts, I made PatchF1GP a lot more space efficient. Despite adding a whole pile of new stuff, the code size has only gone up 500 bytes.
  • Fixed a minor bug in the auto-interrupt-speed-detection routine.
  • Added new commandline options: tcoff, notc, noint.
  • Lots of general code cleanup.

V1.8 23 June 1995 (11520 bytes)

  • Added much more efficient method of detecting when F1GP quits.
  • Implemented software joystick button debouncing.
  • In a fit of efficiency, optimized a whole lot of things (including removing all those patching messages), resulting in a saving of about 4K disk space and about 12K ram :) Now it should work better on 1Mb systems (no more crashes due to lack of ram).
  • Added some more buffering, this time to the directions in keyboard and digital joystick modes, so that delicate fine directional manoeuvres will get noticed.
  • Added command line options: swapjbuttons, kbutton1, and kbutton2.
  • Fixed a whole lot of complete rubbish code to do with analog sticks
  • Added a patch that will turn off f1gp's horsepower degradation.
  • Added the frame rate fix.
  • Now PatchF1GP will start F1GP at the correct real frame rate too.
  • Now PatchF1GP patches into the VBlank interrupt, so the fast/medium/slow options have been removed.

V1.9 5 September 1995 (12112 bytes)

  • Fixed the bug in the steering when TC was off.
  • Added a pit speed limit for the players car.
  • Added some extra command line options.
Amiga Formula One

Utilities
IAF1GPC
Hall of Fame
PerfBase
Troubleshooting
F1GP Links
Mailing List
Webring
Music
FAQ
Amiga Links
F1 Links

What's New
Guestbook
About



Page design by Oliver Roberts - Copyright © 1994-1998, All Rights Reserved.